package com.simtop.dao;

import com.simtop.pojo.Ud;
import com.simtop.pojo.Uds;
import com.simtop.pojo.experiment.Experiment;
import com.simtop.pojo.experiment.ExperimentDynamicVo;
import com.simtop.pojo.experiment.ExperimentReportVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lvyongwei
 */
@Mapper
public interface ExperimentMapper {

    /**
     * 添加实验报告
     * @param experiment
     * @return
     */
    public boolean insertExperiment(Experiment experiment);

    /**
     * 修改实验报告
     * @param experiment
     * @return
     */
    public boolean updateExperiment(Experiment experiment);

    /**
     * 作品动态列表
     * @param message 关键字
     * @return
     */
    public List<ExperimentDynamicVo> getAllDynamic(String message);

    /**
     * 实验报告列表
     * @param userId
     * @param message 关键字
     * @return
     */
    public List<ExperimentReportVo> getAllReport(@Param("userId") Integer userId, @Param("message") String message);

    /**
     * 点赞和取消点赞使用的是redis，因此此处无用
     */
    /**
     * 点赞
     * @param userId
     * @param experimentId
     * @return
     */
    public boolean giveLike(@Param("userId")Integer userId,@Param("experimentId")Long experimentId);

    /**
     * 取消点赞
     * @param userId
     * @param experimentId
     * @return
     */
    public boolean unGiveLike(@Param("userId")Integer userId,@Param("experimentId")Long experimentId);

    /**
     * 删除实验报告
     * @param experimentId
     * @return
     */
    public boolean delete(Long experimentId);

    void addud(@Param("id") int id, @Param("username") String username, @Param("one0") Object one0, @Param("oneformat1") String oneformat1, @Param("oneformat2") String oneformat2, @Param("one3") Object one3, @Param("one4") Object one4,
               @Param("two0") Object two0, @Param("twoformat1") String twoformat1, @Param("twoformat2") String twoformat2, @Param("two3") Object two3, @Param("two4") Object two4,
               @Param("three0") Object three0,@Param("threeformat1") String threeformat1,@Param("threeformat2") String threeformat2,@Param("three3") Object three3,@Param("three4") Object three4,
               @Param("for0") Object for0, @Param("forformat1") String forformat1,@Param("forformat2") String forformat2, @Param("for3") Object for3,@Param("for4") Object for4,
               @Param("five0") Object five0, @Param("fiveformat1") String fiveformat1,@Param("fiveformat2") String fiveformat2, @Param("five3") Object five3, @Param("five4") Object five4,
               @Param("six0") Object six0, @Param("sixformat1") String sixformat1,@Param("sixformat2") String sixformat2, @Param("six3") Object six3, @Param("six4") Object six4,
               @Param("seven0") Object seven0, @Param("sevenformat1") String sevenformat1,@Param("sevenformat2") String sevenformat2, @Param("seven3") Object seven3, @Param("seven4") Object seven4,
               @Param("eight0") Object eight0, @Param("eightformat1") String eightformat1, @Param("eightformat2") String eightformat2, @Param("eight3") Object eight3, @Param("eight4") Object eight4,
               @Param("nine0") Object nine0,@Param("nineformat1") String nineformat1, @Param("nineformat2") String nineformat2, @Param("nine3") Object nine3, @Param("nine4") Object nine4,
               @Param("ten0") Object ten0,@Param("tenformat1") String tenformat1, @Param("tenformat2") String tenformat2, @Param("ten3") Object ten3, @Param("ten4") Object ten4,
               @Param("last0") Object last0,@Param("lastformat1") String lastformat1,@Param("lastformat2") String lastformat2,@Param("last3") Object last3, @Param("last4") Object last4,
                @Param("udalltime")String udalltime);

    List<Ud> allsy(@Param("userid") int userid);

    List<Ud> allallsy();

    void deleteExperimental(@Param("udId") int udId);

    void addu3d02(@Param("id") int id, @Param("username") String username, @Param("data") String data,@Param("formatdata") String formatdata);

    List<Uds> allsy2(@Param("userid") int userid);

    List<Uds> allallsy02();
}
